//package com.speedchina.permission.base.config;
//
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.servlet.config.annotation.CorsRegistry;
//import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
//
///**
// * 配置以/**开头访问请求跨域
// * @author Winter
// */
//@Configuration
////@EnableWebMvc
//public class WebMvcConfiguration extends WebMvcConfigurerAdapter {
//
//    @Override
//    public void addCorsMappings(CorsRegistry registry) {
//        registry.addMapping("/**")
////        registry.addMapping("**")
//                .allowedOrigins("*")
//                .allowedMethods("POST", "GET","PUT", "DELETE")
//                .allowCredentials(true)
//                .allowedHeaders("*")
//                .maxAge(3600);
//    }
//    @Override
//    public void addResourceHandlers(final ResourceHandlerRegistry registry) {
//        // addResourceHandler：配置匹配的静态资源的请求路径
//        // addResourceLocations：配置静态资源的位置
//        // 即请求路径为/static/**的请求都在/resources/目录查找
//        registry.addResourceHandler("/static/**").addResourceLocations("/resources/");
//    }
//}
